package com.ls.resourceloader;

import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

import java.io.IOException;

public class PathMatchingResourcePatternResolverDemo {
	public static void main(String[] args) throws IOException {
		DefaultResourceLoader loader = new DefaultResourceLoader();
		PathMatchingResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver(loader);
		//PathMatchingResourcePatternResolver支持通配符*
		Resource[] resources = resourcePatternResolver.getResources("classpath*:*.xml");
		if(resources != null && resources.length > 0){
			System.out.println("存在");
		}
		else{
			System.out.println("不存在");
		}

	}
}
